package com.jt.tenant.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.jt.tenant.R;
import com.jt.tenant.app.JTApplication;
import com.zcx.helper.pager.Guide;

/**
 * Created by Administrator on 2016/1/30.
 */
public class GuideView extends Guide{

    public GuideView(Context context, AttributeSet attrs) {

        super(context, attrs);

    }

    @Override
    protected boolean slideEnd() {

        return false;

    }

    @Override
    protected View getView(View view) {

        return JTApplication.ScaleScreenHelper.loadView((ViewGroup)view);

    }

    @Override
    protected View indicatorLayout(LinearLayout indicatorLayout) {

        int size = JTApplication.ScaleScreenHelper.getWidthHeight(12);

        indicatorLayout.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL);

        indicatorLayout.setPadding(0, size, 0, size);

        return indicatorLayout;

    }

    @Override
    protected View indicator(View indicator) {

        int size = JTApplication.ScaleScreenHelper.getWidthHeight(20);

        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(size, size);

        layoutParams.leftMargin = layoutParams.rightMargin = size / 2;

        indicator.setLayoutParams(layoutParams);

        return indicator;

    }

    @Override
    protected int indicatorOn() {

        return R.mipmap.home_indicator_on;

    }

    @Override
    protected int indicatorOff() {

        return R.mipmap.home_indicator_off;

    }

}
